﻿using System;
using Zove.Runtime;
using Zove.Shell;
using FunctionalCLR.Shell;
using Zove.Shell.Core;

namespace Zove.Shell.Modelling
{
    public class InspectNode : ContextFuncNode
    {
        public InspectNode() :
            base("inspect") {
        }

        public ZoveShellContext ShellContext
        {
            get
            {
                return Context as ZoveShellContext;
            }
        }

        public override object Evaluate() {
            if (Parameters.Count < 1) {
                throw new ArgumentException(
                    "usage: inspect(model);");
            }

            string instanceName
                = Convert.ToString(Parameters[0].Evaluate());
            Instance instance
                = ShellContext.GetInstance(instanceName);

            return string.Empty;
        }
    }
}
